package com.samphanie.ane.admin.authorize;

import com.samphanie.ane.core.security.authorize.AuthorizeConfigProvider;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;

/**
 * @Author ZSY
 * @createTime 2021/3/13 15:50
 *
 * 默认的授权配置，对常见的静态资源，如js,css，图片等不验证身份
 */
public class AdminAuthorizeConfigProvider implements AuthorizeConfigProvider {
    @Override
    public boolean config(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry config) throws Exception {

//        config.antMatchers(
//                HttpMethod.GET,
//                "swagger-ui.html",
//                "/swagger-resources/**",
//                "/swagger/**",
//                "/**/*.js",
//                "/**/*.css",
//                "/**/*.jpg",
//                "/**/*.png",
//                "/**/*.gif",
//                "/druid/**",
//                "/actuator/**",
//                SecurityCoreConstants.DEFAULT_SOCIAL_USER_INFO_URL
//                ).permitAll();

        return false;
    }
}
